namespace ScrumSprintMonitor.Modules.WorkItemMonitor.ViewModels
{
	#region #using Directives

	using ContinuousLinq.Reactive;

	using UI.Wpf.ViewModels;

	#endregion

	public class WorkItemPieChartData : ReactiveObject,
	                                    IWorkItemPieChartData
	{
		private bool actualValueCanBeHigher;
		private string stateName;
		private double value;

		#region IWorkItemPieChartData Members

		public string StateName
		{
			get { return this.stateName; }
			set
			{
				if (value != this.stateName)
				{
					this.stateName = value;

					OnPropertyChanged("StateName");
				}
			}
		}

		public double Value
		{
			get { return this.value; }
			set
			{
				if (value != this.value)
				{
					this.value = value;

					OnPropertyChanged("Value");
				}
			}
		}

		public bool ActualValueCanBeHigher
		{
			get { return this.actualValueCanBeHigher; }
			set
			{
				if (value != this.actualValueCanBeHigher)
				{
					this.actualValueCanBeHigher = value;

					OnPropertyChanged("ActualValueCanBeHigher");
				}
			}
		}

		public virtual bool ValueIsHours
		{
			get { return false; }
		}

		#endregion

		public override string ToString()
		{
			return string.Format("{0}: {1:N0}", StateName, Value);
		}
	}
}